import socket
import sys
sys.path.append("..") 
import tensor2buff
from tensor2buff import HEADER_SIZE
import torch
import json

client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(("192.168.150.96", 8080))

t = torch.randn(1,3,224,224)
info, zbuf = tensor2buff.pack(t)
json_info = f"{json.dumps(info): <1024}"
client.send(json_info.encode('utf-8'))
client.send(zbuf)